package com.websocket.event;

import java.security.Principal;

public class WebSocketPublishEvent extends AbstractSubProtocolEvent {

    private final String message;
    private final boolean broadcast;

    public WebSocketPublishEvent(Object source, String message, boolean broadcast, Principal user) {
        super(source, user);
        this.message = message;
        this.broadcast = broadcast;
    }

    public String getMessage(){
        return message;
    }

    public boolean isBroadcast() {
        return broadcast;
    }
}